{{-- resources\views\article\main.blade.php --}}
<div hidden>@dump($article)</div>
@include('custom.phpFunction')
@php
    // 设置时区
    date_default_timezone_set(env('USER_TIMEZONE', 'PRC'));
    $classify_kv = array_column(objectToArray($classify), 'cname', 'cid');
    $cid = $article->cid;
@endphp
<br>
<h1>{{ merge_str($article->title, $article->title2) }}</h1>
<hr>
<small class="text-muted">创建于：{{ date("Y-m-d H:i",$article->date)."/最后修改于：".date("Y-m-d H:i",$article->lastdate)." |"}}</small>
    @php
        echo '<small class="text-muted"><a class="text-info" href="/search?q='.$cid.'"' . "> $cid : $classify_kv[$cid]".'</a></small>';
        if (session('uEmail', 'null') != 'null') {
            echo '<small class="text-muted"> | <a class="text-info" href="'.route('update', ['id'=>$id]).'">Edit</a></small>';
        }
    @endphp
<br><br>
<div id="ach">
{{--     
    @php
        echo $article->content; 
    @endphp
    --}}
</div>
<script src="/js/marked.min.js"></script>
  <script>
    articleContent = `{{ $article->content }}`;//todo 使用`会导致报错
    ach = document.getElementById("ach")
    ach.innerHTML = marked.parse(articleContent);
  </script>